<script setup>
import { onMounted, ref } from 'vue'
import { get, post } from './../utils/http/axios'

const list = ref('')
const list2 = ref('')
const getInfo = () => {
  get('/api/posts/1', {}, { cache: true }).then((res) => {
    list.value = JSON.stringify(res)
  })
}
const getInfo2 = () => {
  post('/api/posts', {}, { cache: true }).then((res) => {
    list2.value = JSON.stringify(res)
  })
}

onMounted(() => {})
</script>

<template>
  <div>
    <div>TestCache</div>
    <div>
      <button @click="getInfo">getUser: get</button>
      <div>{{ list }}</div>
    </div>
    <div>
      <button @click="getInfo2">getUser2: post</button>
      <div>{{ list2 }}</div>
    </div>
  </div>
</template>

<style></style>
